package torque.generated;


import java.math.BigDecimal;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;

import org.apache.commons.lang.ObjectUtils;
import org.apache.torque.TorqueException;
import org.apache.torque.map.TableMap;
import org.apache.torque.om.BaseObject;
import org.apache.torque.om.ComboKey;
import org.apache.torque.om.DateKey;
import org.apache.torque.om.NumberKey;
import org.apache.torque.om.ObjectKey;
import org.apache.torque.om.SimpleKey;
import org.apache.torque.om.StringKey;
import org.apache.torque.om.Persistent;
import org.apache.torque.util.Criteria;
import org.apache.torque.util.Transaction;





/**
 * positionVaisseau Table
 *
 * This class was autogenerated by Torque on:
 *
 * [Wed Mar 21 10:21:18 CET 2012]
 *
 * You should not use this class directly.  It should not even be
 * extended all references should be to Positionvaisseau
 */
public abstract class BasePositionvaisseau extends BaseObject
{
    /** Serial version */
    private static final long serialVersionUID = 1332321678105L;

    /** The Peer class */
    private static final PositionvaisseauPeer peer =
        new PositionvaisseauPeer();


    /** The value for the idvaisseau field */
    private int idvaisseau;

    /** The value for the x field */
    private int x;

    /** The value for the y field */
    private int y;

    /** The value for the ptattaque field */
    private int ptattaque;

    /** The value for the ptdegat field */
    private int ptdegat;

    /** The value for the ptchampforce field */
    private int ptchampforce;

    /** The value for the ptenergie field */
    private int ptenergie;

    /** The value for the ptaction field */
    private int ptaction;

    /** The value for the nomvaisseau field */
    private String nomvaisseau;

    /** The value for the nompartie field */
    private String nompartie;


    /**
     * Get the Idvaisseau
     *
     * @return int
     */
    public int getIdvaisseau()
    {
        return idvaisseau;
    }


    /**
     * Set the value of Idvaisseau
     *
     * @param v new value
     */
    public void setIdvaisseau(int v) 
    {

        if (this.idvaisseau != v)
        {
            this.idvaisseau = v;
            setModified(true);
        }


    }

    /**
     * Get the X
     *
     * @return int
     */
    public int getX()
    {
        return x;
    }


    /**
     * Set the value of X
     *
     * @param v new value
     */
    public void setX(int v) 
    {

        if (this.x != v)
        {
            this.x = v;
            setModified(true);
        }


    }

    /**
     * Get the Y
     *
     * @return int
     */
    public int getY()
    {
        return y;
    }


    /**
     * Set the value of Y
     *
     * @param v new value
     */
    public void setY(int v) 
    {

        if (this.y != v)
        {
            this.y = v;
            setModified(true);
        }


    }

    /**
     * Get the Ptattaque
     *
     * @return int
     */
    public int getPtattaque()
    {
        return ptattaque;
    }


    /**
     * Set the value of Ptattaque
     *
     * @param v new value
     */
    public void setPtattaque(int v) 
    {

        if (this.ptattaque != v)
        {
            this.ptattaque = v;
            setModified(true);
        }


    }

    /**
     * Get the Ptdegat
     *
     * @return int
     */
    public int getPtdegat()
    {
        return ptdegat;
    }


    /**
     * Set the value of Ptdegat
     *
     * @param v new value
     */
    public void setPtdegat(int v) 
    {

        if (this.ptdegat != v)
        {
            this.ptdegat = v;
            setModified(true);
        }


    }

    /**
     * Get the Ptchampforce
     *
     * @return int
     */
    public int getPtchampforce()
    {
        return ptchampforce;
    }


    /**
     * Set the value of Ptchampforce
     *
     * @param v new value
     */
    public void setPtchampforce(int v) 
    {

        if (this.ptchampforce != v)
        {
            this.ptchampforce = v;
            setModified(true);
        }


    }

    /**
     * Get the Ptenergie
     *
     * @return int
     */
    public int getPtenergie()
    {
        return ptenergie;
    }


    /**
     * Set the value of Ptenergie
     *
     * @param v new value
     */
    public void setPtenergie(int v) 
    {

        if (this.ptenergie != v)
        {
            this.ptenergie = v;
            setModified(true);
        }


    }

    /**
     * Get the Ptaction
     *
     * @return int
     */
    public int getPtaction()
    {
        return ptaction;
    }


    /**
     * Set the value of Ptaction
     *
     * @param v new value
     */
    public void setPtaction(int v) 
    {

        if (this.ptaction != v)
        {
            this.ptaction = v;
            setModified(true);
        }


    }

    /**
     * Get the Nomvaisseau
     *
     * @return String
     */
    public String getNomvaisseau()
    {
        return nomvaisseau;
    }


    /**
     * Set the value of Nomvaisseau
     *
     * @param v new value
     */
    public void setNomvaisseau(String v) throws TorqueException
    {

        if (!ObjectUtils.equals(this.nomvaisseau, v))
        {
            this.nomvaisseau = v;
            setModified(true);
        }


        if (aVaisseau != null && !ObjectUtils.equals(aVaisseau.getNomv(), v))
        {
            aVaisseau = null;
        }

    }

    /**
     * Get the Nompartie
     *
     * @return String
     */
    public String getNompartie()
    {
        return nompartie;
    }


    /**
     * Set the value of Nompartie
     *
     * @param v new value
     */
    public void setNompartie(String v) throws TorqueException
    {

        if (!ObjectUtils.equals(this.nompartie, v))
        {
            this.nompartie = v;
            setModified(true);
        }


        if (aPartie != null && !ObjectUtils.equals(aPartie.getNomp(), v))
        {
            aPartie = null;
        }

    }

    



    private Vaisseau aVaisseau;

    /**
     * Declares an association between this object and a Vaisseau object
     *
     * @param v Vaisseau
     * @throws TorqueException
     */
    public void setVaisseau(Vaisseau v) throws TorqueException
    {
        if (v == null)
        {
            setNomvaisseau((String) null);
        }
        else
        {
            setNomvaisseau(v.getNomv());
        }
        aVaisseau = v;
    }


    /**
     * Returns the associated Vaisseau object.
     * If it was not retrieved before, the object is retrieved from
     * the database
     *
     * @return the associated Vaisseau object
     * @throws TorqueException
     */
    public Vaisseau getVaisseau()
        throws TorqueException
    {
        if (aVaisseau == null && (!ObjectUtils.equals(this.nomvaisseau, null)))
        {
            aVaisseau = VaisseauPeer.retrieveByPK(SimpleKey.keyFor(this.nomvaisseau));
        }
        return aVaisseau;
    }

    /**
     * Return the associated Vaisseau object
     * If it was not retrieved before, the object is retrieved from
     * the database using the passed connection
     *
     * @param connection the connection used to retrieve the associated object
     *        from the database, if it was not retrieved before
     * @return the associated Vaisseau object
     * @throws TorqueException
     */
    public Vaisseau getVaisseau(Connection connection)
        throws TorqueException
    {
        if (aVaisseau == null && (!ObjectUtils.equals(this.nomvaisseau, null)))
        {
            aVaisseau = VaisseauPeer.retrieveByPK(SimpleKey.keyFor(this.nomvaisseau), connection);
        }
        return aVaisseau;
    }

    /**
     * Provides convenient way to set a relationship based on a
     * ObjectKey, for example
     * <code>bar.setFooKey(foo.getPrimaryKey())</code>
     *
     */
    public void setVaisseauKey(ObjectKey key) throws TorqueException
    {

        setNomvaisseau(key.toString());
    }




    private Partie aPartie;

    /**
     * Declares an association between this object and a Partie object
     *
     * @param v Partie
     * @throws TorqueException
     */
    public void setPartie(Partie v) throws TorqueException
    {
        if (v == null)
        {
            setNompartie((String) null);
        }
        else
        {
            setNompartie(v.getNomp());
        }
        aPartie = v;
    }


    /**
     * Returns the associated Partie object.
     * If it was not retrieved before, the object is retrieved from
     * the database
     *
     * @return the associated Partie object
     * @throws TorqueException
     */
    public Partie getPartie()
        throws TorqueException
    {
        if (aPartie == null && (!ObjectUtils.equals(this.nompartie, null)))
        {
            aPartie = PartiePeer.retrieveByPK(SimpleKey.keyFor(this.nompartie));
        }
        return aPartie;
    }

    /**
     * Return the associated Partie object
     * If it was not retrieved before, the object is retrieved from
     * the database using the passed connection
     *
     * @param connection the connection used to retrieve the associated object
     *        from the database, if it was not retrieved before
     * @return the associated Partie object
     * @throws TorqueException
     */
    public Partie getPartie(Connection connection)
        throws TorqueException
    {
        if (aPartie == null && (!ObjectUtils.equals(this.nompartie, null)))
        {
            aPartie = PartiePeer.retrieveByPK(SimpleKey.keyFor(this.nompartie), connection);
        }
        return aPartie;
    }

    /**
     * Provides convenient way to set a relationship based on a
     * ObjectKey, for example
     * <code>bar.setFooKey(foo.getPrimaryKey())</code>
     *
     */
    public void setPartieKey(ObjectKey key) throws TorqueException
    {

        setNompartie(key.toString());
    }
   
        
    private static List fieldNames = null;

    /**
     * Generate a list of field names.
     *
     * @return a list of field names
     */
    public static synchronized List getFieldNames()
    {
        if (fieldNames == null)
        {
            fieldNames = new ArrayList();
            fieldNames.add("Idvaisseau");
            fieldNames.add("X");
            fieldNames.add("Y");
            fieldNames.add("Ptattaque");
            fieldNames.add("Ptdegat");
            fieldNames.add("Ptchampforce");
            fieldNames.add("Ptenergie");
            fieldNames.add("Ptaction");
            fieldNames.add("Nomvaisseau");
            fieldNames.add("Nompartie");
            fieldNames = Collections.unmodifiableList(fieldNames);
        }
        return fieldNames;
    }

    /**
     * Retrieves a field from the object by field (Java) name passed in as a String.
     *
     * @param name field name
     * @return value
     */
    public Object getByName(String name)
    {
        if (name.equals("Idvaisseau"))
        {
            return new Integer(getIdvaisseau());
        }
        if (name.equals("X"))
        {
            return new Integer(getX());
        }
        if (name.equals("Y"))
        {
            return new Integer(getY());
        }
        if (name.equals("Ptattaque"))
        {
            return new Integer(getPtattaque());
        }
        if (name.equals("Ptdegat"))
        {
            return new Integer(getPtdegat());
        }
        if (name.equals("Ptchampforce"))
        {
            return new Integer(getPtchampforce());
        }
        if (name.equals("Ptenergie"))
        {
            return new Integer(getPtenergie());
        }
        if (name.equals("Ptaction"))
        {
            return new Integer(getPtaction());
        }
        if (name.equals("Nomvaisseau"))
        {
            return getNomvaisseau();
        }
        if (name.equals("Nompartie"))
        {
            return getNompartie();
        }
        return null;
    }

    /**
     * Set a field in the object by field (Java) name.
     *
     * @param name field name
     * @param value field value
     * @return True if value was set, false if not (invalid name / protected field).
     * @throws IllegalArgumentException if object type of value does not match field object type.
     * @throws TorqueException If a problem occurs with the set[Field] method.
     */
    public boolean setByName(String name, Object value )
        throws TorqueException, IllegalArgumentException
    {
        if (name.equals("Idvaisseau"))
        {
            if (value == null || ! (Integer.class.isInstance(value)))
            {
                throw new IllegalArgumentException("setByName: value parameter was null or not an Integer object.");
            }
            setIdvaisseau(((Integer) value).intValue());
            return true;
        }
        if (name.equals("X"))
        {
            if (value == null || ! (Integer.class.isInstance(value)))
            {
                throw new IllegalArgumentException("setByName: value parameter was null or not an Integer object.");
            }
            setX(((Integer) value).intValue());
            return true;
        }
        if (name.equals("Y"))
        {
            if (value == null || ! (Integer.class.isInstance(value)))
            {
                throw new IllegalArgumentException("setByName: value parameter was null or not an Integer object.");
            }
            setY(((Integer) value).intValue());
            return true;
        }
        if (name.equals("Ptattaque"))
        {
            if (value == null || ! (Integer.class.isInstance(value)))
            {
                throw new IllegalArgumentException("setByName: value parameter was null or not an Integer object.");
            }
            setPtattaque(((Integer) value).intValue());
            return true;
        }
        if (name.equals("Ptdegat"))
        {
            if (value == null || ! (Integer.class.isInstance(value)))
            {
                throw new IllegalArgumentException("setByName: value parameter was null or not an Integer object.");
            }
            setPtdegat(((Integer) value).intValue());
            return true;
        }
        if (name.equals("Ptchampforce"))
        {
            if (value == null || ! (Integer.class.isInstance(value)))
            {
                throw new IllegalArgumentException("setByName: value parameter was null or not an Integer object.");
            }
            setPtchampforce(((Integer) value).intValue());
            return true;
        }
        if (name.equals("Ptenergie"))
        {
            if (value == null || ! (Integer.class.isInstance(value)))
            {
                throw new IllegalArgumentException("setByName: value parameter was null or not an Integer object.");
            }
            setPtenergie(((Integer) value).intValue());
            return true;
        }
        if (name.equals("Ptaction"))
        {
            if (value == null || ! (Integer.class.isInstance(value)))
            {
                throw new IllegalArgumentException("setByName: value parameter was null or not an Integer object.");
            }
            setPtaction(((Integer) value).intValue());
            return true;
        }
        if (name.equals("Nomvaisseau"))
        {
            // Object fields can be null
            if (value != null && ! String.class.isInstance(value))
            {
                throw new IllegalArgumentException("Invalid type of object specified for value in setByName");
            }
            setNomvaisseau((String) value);
            return true;
        }
        if (name.equals("Nompartie"))
        {
            // Object fields can be null
            if (value != null && ! String.class.isInstance(value))
            {
                throw new IllegalArgumentException("Invalid type of object specified for value in setByName");
            }
            setNompartie((String) value);
            return true;
        }
        return false;
    }

    /**
     * Retrieves a field from the object by name passed in
     * as a String.  The String must be one of the static
     * Strings defined in this Class' Peer.
     *
     * @param name peer name
     * @return value
     */
    public Object getByPeerName(String name)
    {
        if (name.equals(PositionvaisseauPeer.IDVAISSEAU))
        {
            return new Integer(getIdvaisseau());
        }
        if (name.equals(PositionvaisseauPeer.X))
        {
            return new Integer(getX());
        }
        if (name.equals(PositionvaisseauPeer.Y))
        {
            return new Integer(getY());
        }
        if (name.equals(PositionvaisseauPeer.PTATTAQUE))
        {
            return new Integer(getPtattaque());
        }
        if (name.equals(PositionvaisseauPeer.PTDEGAT))
        {
            return new Integer(getPtdegat());
        }
        if (name.equals(PositionvaisseauPeer.PTCHAMPFORCE))
        {
            return new Integer(getPtchampforce());
        }
        if (name.equals(PositionvaisseauPeer.PTENERGIE))
        {
            return new Integer(getPtenergie());
        }
        if (name.equals(PositionvaisseauPeer.PTACTION))
        {
            return new Integer(getPtaction());
        }
        if (name.equals(PositionvaisseauPeer.NOMVAISSEAU))
        {
            return getNomvaisseau();
        }
        if (name.equals(PositionvaisseauPeer.NOMPARTIE))
        {
            return getNompartie();
        }
        return null;
    }

    /**
     * Set field values by Peer Field Name
     *
     * @param name field name
     * @param value field value
     * @return True if value was set, false if not (invalid name / protected field).
     * @throws IllegalArgumentException if object type of value does not match field object type.
     * @throws TorqueException If a problem occurs with the set[Field] method.
     */
    public boolean setByPeerName(String name, Object value)
        throws TorqueException, IllegalArgumentException
    {
      if (PositionvaisseauPeer.IDVAISSEAU.equals(name))
        {
            return setByName("Idvaisseau", value);
        }
      if (PositionvaisseauPeer.X.equals(name))
        {
            return setByName("X", value);
        }
      if (PositionvaisseauPeer.Y.equals(name))
        {
            return setByName("Y", value);
        }
      if (PositionvaisseauPeer.PTATTAQUE.equals(name))
        {
            return setByName("Ptattaque", value);
        }
      if (PositionvaisseauPeer.PTDEGAT.equals(name))
        {
            return setByName("Ptdegat", value);
        }
      if (PositionvaisseauPeer.PTCHAMPFORCE.equals(name))
        {
            return setByName("Ptchampforce", value);
        }
      if (PositionvaisseauPeer.PTENERGIE.equals(name))
        {
            return setByName("Ptenergie", value);
        }
      if (PositionvaisseauPeer.PTACTION.equals(name))
        {
            return setByName("Ptaction", value);
        }
      if (PositionvaisseauPeer.NOMVAISSEAU.equals(name))
        {
            return setByName("Nomvaisseau", value);
        }
      if (PositionvaisseauPeer.NOMPARTIE.equals(name))
        {
            return setByName("Nompartie", value);
        }
        return false;
    }

    /**
     * Retrieves a field from the object by Position as specified
     * in the xml schema.  Zero-based.
     *
     * @param pos position in xml schema
     * @return value
     */
    public Object getByPosition(int pos)
    {
        if (pos == 0)
        {
            return new Integer(getIdvaisseau());
        }
        if (pos == 1)
        {
            return new Integer(getX());
        }
        if (pos == 2)
        {
            return new Integer(getY());
        }
        if (pos == 3)
        {
            return new Integer(getPtattaque());
        }
        if (pos == 4)
        {
            return new Integer(getPtdegat());
        }
        if (pos == 5)
        {
            return new Integer(getPtchampforce());
        }
        if (pos == 6)
        {
            return new Integer(getPtenergie());
        }
        if (pos == 7)
        {
            return new Integer(getPtaction());
        }
        if (pos == 8)
        {
            return getNomvaisseau();
        }
        if (pos == 9)
        {
            return getNompartie();
        }
        return null;
    }

    /**
     * Set field values by its position (zero based) in the XML schema.
     *
     * @param position The field position
     * @param value field value
     * @return True if value was set, false if not (invalid position / protected field).
     * @throws IllegalArgumentException if object type of value does not match field object type.
     * @throws TorqueException If a problem occurs with the set[Field] method.
     */
    public boolean setByPosition(int position, Object value)
        throws TorqueException, IllegalArgumentException
    {
    if (position == 0)
        {
            return setByName("Idvaisseau", value);
        }
    if (position == 1)
        {
            return setByName("X", value);
        }
    if (position == 2)
        {
            return setByName("Y", value);
        }
    if (position == 3)
        {
            return setByName("Ptattaque", value);
        }
    if (position == 4)
        {
            return setByName("Ptdegat", value);
        }
    if (position == 5)
        {
            return setByName("Ptchampforce", value);
        }
    if (position == 6)
        {
            return setByName("Ptenergie", value);
        }
    if (position == 7)
        {
            return setByName("Ptaction", value);
        }
    if (position == 8)
        {
            return setByName("Nomvaisseau", value);
        }
    if (position == 9)
        {
            return setByName("Nompartie", value);
        }
        return false;
    }
     
    /**
     * Stores the object in the database.  If the object is new,
     * it inserts it; otherwise an update is performed.
     *
     * @throws Exception
     */
    public void save() throws Exception
    {
        save(PositionvaisseauPeer.DATABASE_NAME);
    }

    /**
     * Stores the object in the database.  If the object is new,
     * it inserts it; otherwise an update is performed.
     * Note: this code is here because the method body is
     * auto-generated conditionally and therefore needs to be
     * in this file instead of in the super class, BaseObject.
     *
     * @param dbName
     * @throws TorqueException
     */
    public void save(String dbName) throws TorqueException
    {
        Connection con = null;
        try
        {
            con = Transaction.begin(dbName);
            save(con);
            Transaction.commit(con);
        }
        catch(TorqueException e)
        {
            Transaction.safeRollback(con);
            throw e;
        }
    }

    /** flag to prevent endless save loop, if this object is referenced
        by another object which falls in this transaction. */
    private boolean alreadyInSave = false;
    /**
     * Stores the object in the database.  If the object is new,
     * it inserts it; otherwise an update is performed.  This method
     * is meant to be used as part of a transaction, otherwise use
     * the save() method and the connection details will be handled
     * internally
     *
     * @param con
     * @throws TorqueException
     */
    public void save(Connection con) throws TorqueException
    {
        if (!alreadyInSave)
        {
            alreadyInSave = true;



            // If this object has been modified, then save it to the database.
            if (isModified())
            {
                if (isNew())
                {
                    PositionvaisseauPeer.doInsert((Positionvaisseau) this, con);
                    setNew(false);
                }
                else
                {
                    PositionvaisseauPeer.doUpdate((Positionvaisseau) this, con);
                }
            }

            alreadyInSave = false;
        }
    }


    /**
     * Set the PrimaryKey using ObjectKey.
     *
     * @param key idvaisseau ObjectKey
     */
    public void setPrimaryKey(ObjectKey key)
        
    {
        setIdvaisseau(((NumberKey) key).intValue());
    }

    /**
     * Set the PrimaryKey using a String.
     *
     * @param key
     */
    public void setPrimaryKey(String key) 
    {
        setIdvaisseau(Integer.parseInt(key));
    }


    /**
     * returns an id that differentiates this object from others
     * of its class.
     */
    public ObjectKey getPrimaryKey()
    {
        return SimpleKey.keyFor(getIdvaisseau());
    }
 

    /**
     * Makes a copy of this object.
     * It creates a new object filling in the simple attributes.
     * It then fills all the association collections and sets the
     * related objects to isNew=true.
     */
    public Positionvaisseau copy() throws TorqueException
    {
        return copy(true);
    }

    /**
     * Makes a copy of this object using connection.
     * It creates a new object filling in the simple attributes.
     * It then fills all the association collections and sets the
     * related objects to isNew=true.
     *
     * @param con the database connection to read associated objects.
     */
    public Positionvaisseau copy(Connection con) throws TorqueException
    {
        return copy(true, con);
    }

    /**
     * Makes a copy of this object.
     * It creates a new object filling in the simple attributes.
     * If the parameter deepcopy is true, it then fills all the
     * association collections and sets the related objects to
     * isNew=true.
     *
     * @param deepcopy whether to copy the associated objects.
     */
    public Positionvaisseau copy(boolean deepcopy) throws TorqueException
    {
        return copyInto(new Positionvaisseau(), deepcopy);
    }

    /**
     * Makes a copy of this object using connection.
     * It creates a new object filling in the simple attributes.
     * If the parameter deepcopy is true, it then fills all the
     * association collections and sets the related objects to
     * isNew=true.
     *
     * @param deepcopy whether to copy the associated objects.
     * @param con the database connection to read associated objects.
     */
    public Positionvaisseau copy(boolean deepcopy, Connection con) throws TorqueException
    {
        return copyInto(new Positionvaisseau(), deepcopy, con);
    }
  
    /**
     * Fills the copyObj with the contents of this object.
     * The associated objects are also copied and treated as new objects.
     *
     * @param copyObj the object to fill.
     */
    protected Positionvaisseau copyInto(Positionvaisseau copyObj) throws TorqueException
    {
        return copyInto(copyObj, true);
    }

  
    /**
     * Fills the copyObj with the contents of this object using connection.
     * The associated objects are also copied and treated as new objects.
     *
     * @param copyObj the object to fill.
     * @param con the database connection to read associated objects.
     */
    protected Positionvaisseau copyInto(Positionvaisseau copyObj, Connection con) throws TorqueException
    {
        return copyInto(copyObj, true, con);
    }
  
    /**
     * Fills the copyObj with the contents of this object.
     * If deepcopy is true, The associated objects are also copied
     * and treated as new objects.
     *
     * @param copyObj the object to fill.
     * @param deepcopy whether the associated objects should be copied.
     */
    protected Positionvaisseau copyInto(Positionvaisseau copyObj, boolean deepcopy) throws TorqueException
    {
        copyObj.setIdvaisseau(idvaisseau);
        copyObj.setX(x);
        copyObj.setY(y);
        copyObj.setPtattaque(ptattaque);
        copyObj.setPtdegat(ptdegat);
        copyObj.setPtchampforce(ptchampforce);
        copyObj.setPtenergie(ptenergie);
        copyObj.setPtaction(ptaction);
        copyObj.setNomvaisseau(nomvaisseau);
        copyObj.setNompartie(nompartie);

        copyObj.setIdvaisseau( 0);

        if (deepcopy)
        {
        }
        return copyObj;
    }
        
    
    /**
     * Fills the copyObj with the contents of this object using connection.
     * If deepcopy is true, The associated objects are also copied
     * and treated as new objects.
     *
     * @param copyObj the object to fill.
     * @param deepcopy whether the associated objects should be copied.
     * @param con the database connection to read associated objects.
     */
    protected Positionvaisseau copyInto(Positionvaisseau copyObj, boolean deepcopy, Connection con) throws TorqueException
    {
        copyObj.setIdvaisseau(idvaisseau);
        copyObj.setX(x);
        copyObj.setY(y);
        copyObj.setPtattaque(ptattaque);
        copyObj.setPtdegat(ptdegat);
        copyObj.setPtchampforce(ptchampforce);
        copyObj.setPtenergie(ptenergie);
        copyObj.setPtaction(ptaction);
        copyObj.setNomvaisseau(nomvaisseau);
        copyObj.setNompartie(nompartie);

        copyObj.setIdvaisseau( 0);

        if (deepcopy)
        {
        }
        return copyObj;
    }
    
    

    /**
     * returns a peer instance associated with this om.  Since Peer classes
     * are not to have any instance attributes, this method returns the
     * same instance for all member of this class. The method could therefore
     * be static, but this would prevent one from overriding the behavior.
     */
    public PositionvaisseauPeer getPeer()
    {
        return peer;
    }

    /**
     * Retrieves the TableMap object related to this Table data without
     * compiler warnings of using getPeer().getTableMap().
     *
     * @return The associated TableMap object.
     */
    public TableMap getTableMap() throws TorqueException
    {
        return PositionvaisseauPeer.getTableMap();
    }


    public String toString()
    {
        StringBuffer str = new StringBuffer();
        str.append("Positionvaisseau:\n");
        str.append("Idvaisseau = ")
           .append(getIdvaisseau())
           .append("\n");
        str.append("X = ")
           .append(getX())
           .append("\n");
        str.append("Y = ")
           .append(getY())
           .append("\n");
        str.append("Ptattaque = ")
           .append(getPtattaque())
           .append("\n");
        str.append("Ptdegat = ")
           .append(getPtdegat())
           .append("\n");
        str.append("Ptchampforce = ")
           .append(getPtchampforce())
           .append("\n");
        str.append("Ptenergie = ")
           .append(getPtenergie())
           .append("\n");
        str.append("Ptaction = ")
           .append(getPtaction())
           .append("\n");
        str.append("Nomvaisseau = ")
           .append(getNomvaisseau())
           .append("\n");
        str.append("Nompartie = ")
           .append(getNompartie())
           .append("\n");
        return(str.toString());
    }
}
